#ifndef _LCD_GRAPH_H_
#define _LCD_GRAPH_H_


#define DDR_LCD_E_RD DDRG
#define DDR_LCD_CS   DDRG
#define DDR_LCD_RW   DDRG
#define DDR_LCD_DC   DDRB
#define DDR_LCD_RES  DDRB

#define PORT_LCD_E_RD PORTG
#define PORT_LCD_CS   PORTG
#define PORT_LCD_RW   PORTG
#define PORT_LCD_DC   PORTB
#define PORT_LCD_RES  PORTB


#define LCD_E_RD PG2
#define LCD_CS   PG1
#define LCD_RW   PG1
#define LCD_DC   PB7
#define LCD_RES  PB6



#define DDR_LCD_DATA   DDRA
#define PORT_LCD_DATA  PORTA
#define PIN_LCD_DATA   PINA

#define  LCD_RES_HIGH PORT_LCD_RES|=1<<LCD_RES;
#define  LCD_RES_LOW  PORT_LCD_RES|=~(1<<LCD_RES);

#define  LCD_E_RD_HIGH PORT_LCD_E_RD|=1<<LCD_E_RD;
#define  LCD_E_RD_LOW  PORT_LCD_E_RD|=~(1<<LCD_E_RD);

#define  LCD_RW_HIGH PORT_LCD_RES|=1<<LCD_RW;
#define  LCD_RW_LOW  PORT_LCD_RES|=~(1<<LCD_RW);

#define  LCD_DC_HIGH PORT_LCD_RES|=1<<LCD_DC;
#define  LCD_DC_LOW  PORT_LCD_RES|=~(1<<LCD_DC);

#define  LCD_CS_HIGH PORT_LCD_RES|=1<<LCD_CS;
#define  LCD_CS_LOW  PORT_LCD_RES|=~(1<<LCD_CS);

void Init_lcd(void);
void write_comannd(unsigned char cmd);
unsigned char read_status(void);
unsigned char read_data(void);
void write_data(unsigned char data);

#endif
